<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>拉拉货物流有限公司</title>
		<meta name="keywords" content="拉拉货物流有限公司,汕头物流配送,汕头物流,汕头物流货运,汕头货运,全国货运,厦门物流配送,深圳物流配送,广州物流配送,物流配送,物流货运,货运配送" />
	    <meta name="description" content="拉拉货物流有限公司是一家承接全国各地门到门配送业务的专业第三方物流，为企业量身定做仓储、配送物流方案，针对大小客户配备专业项目小组进行专人专车对接。" />
	    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	    <link rel="stylesheet" href="css/amazeui.min.css" type="text/css" />
	    <link rel="stylesheet" href="css/style.css" type="text/css" />
	    <script type="text/javascript" src="js/jquery.min.js" ></script>
	    <script type="text/javascript" src="js/amazeui.min.js" ></script>
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
	<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
	</head>
	<body>
		<header data-am-widget="header" class="am-header am-header-default header-green1">
	      <div class="am-header-left am-header-nav ">
		        <a href="index2.html" style="color: #fff;"><i class="am-icon-chevron-left"></i></a>
	        </div>
		  <h1 class="am-header-title" style="color: #fff;">消息</h1>
       </header>
       <div class="jl"></div>
	   <div id="neww">
       <ul class="m-menu" >
		    <li :class="qb"> <a  @click="quanbu" > 全部消息 </a> </li>
			<li :class="wd"> <a  @click="weidu" > 未读消息 </a></li>
		  <li :class="xt"><a @click="xitong">系统消息</a></li>
       	 
		  <li :class="jy"><a @click="jiaoyi" >交易消息</a></li>
       </ul>
       <ul class="message">
       	  <li v-for="nw in news">
       	  	<a  @click="pdcontent(nw)">
       	  		<h2  :style="setStyle(nw.isRead)">{{nw.title}} </h2>
       	  		<p class="time">{{nw.creatTime}}</p>
       	  		<i class="iconfont">&#xe611;</i>
       	  	</a>
       	  </li>
       </ul>
	    </div>
	</body>
	<script type="text/javascript">
		var url=JSON.parse(sessionStorage.getItem("url"))
		var user=JSON.parse(sessionStorage.getItem("user"))
		
		var ne=new Vue({
			el:'#neww',
			data:{
			news:[],
			qb:'',
			xt:'',
			jy:'',
			wd:''
			},
			mounted:function(){
				this.quanbu()
			},
			methods:{
					setStyle(key) {
					           if(key=='0'){
								   return 'color:red'
							   }else{
								   return 'color:black'
							   }
					           
					        },

				xitong:function(){
					this.qb=''
					this.xt='current'
					this.jy=''
					this.wd=''
					var that=this
					axios.get(url+'/clientnews/news?userId='+user.id+'&'+'status='+0).then(
					function(r){
						if(r.data.code==200){
							console.log(r.data.data)
							that.news=r.data.data
						
							
							
						}
						
						
					},function(err){
						
						
					}
					
					
					)	
					
				},
				
				jiaoyi:function(){
					this.qb=''
					this.xt=''
					this.jy='current'
					this.xt='wd'
					var that=this
					axios.get(url+'/clientnews/news?userId='+user.id+'&'+'status='+1).then(
					function(r){
						if(r.data.code==200){
							console.log(r.data.data)
							that.news=r.data.data
							
							
							
						}
						
						
					},function(err){
						
						
					}
					
					
					)	
					
					
				},
				weidu:function(){
					this.qb=''
					this.xt=''
					this.jy=''
					this.wd='current'
					var that=this
					axios.get(url+'/clientnews/read?userId='+user.id).then(
					function(r){
						if(r.data.code==200){
							console.log(r.data.data)
							that.news=r.data.data
							
							
							
						}
						
						
					},function(err){
						
						
					}
					
					
					)	
					
					
				},
				
				pdcontent:function(newss){
				if(newss.status==0){
					this.newcontent(newss)
				}else{
					var newsss=	JSON.stringify(newss)
						sessionStorage.setItem("newss",newsss)
					location.href='socket.html'
				}
					
				},
				
				
				newcontent:function(newss){
				var newsss=	JSON.stringify(newss)
					sessionStorage.setItem("newss",newsss)
					location.href='massage-con.html'
					
				},
				
				quanbu:function(){
					this.qb='current'
					this.xt=''
					this.jy=''
					this.wd=''
					var that=this
					axios.get(url+'/clientnews/news?userId='+user.id).then(
					function(r){
						if(r.data.code==200){
							console.log(r.data.data)
							that.news=r.data.data
						
							
						}
						
						
					},function(err){
						
						
					}
					
					
					)	
					
				}
				
			}
			
			
			
		})
		
		
		
	</script>
	
</html>
